<%@page import="com.dfhc.util.StringHelper"%>
<%@page import="com.dfhc.util.CryptoHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<title>添加 </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>
<article class="page-container">

	<form action="" method="post" class="form form-horizontal" id="form-rmauthorizeresource-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
							
							
		<dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title">权限类别ID：</dfhc:title>	    
		    <dfhc:div templateId="h_ui_div_label_div">	        
				<dfhc:input templateId="h_ui_input" value="${bean.authorize_id}" placeholder="" id="authorize_id" name="authorize_id"/>			
		    </dfhc:div>	 	    		 
		</dfhc:div>
	  
	  
	  
	  
	  	<dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title">资源原始ID：</dfhc:title>	    
		    <dfhc:div templateId="h_ui_div_label_div">	        
				<dfhc:input templateId="h_ui_input" value="${bean.old_resource_id}" placeholder="" id="old_resource_id" name="old_resource_id"/>			
		    </dfhc:div>	 	    		 
		</dfhc:div>		  		 
		
							
	    <dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title">默认直接访问：</dfhc:title>	    
				<dfhc:div templateId="h_ui_div_label_div">
					<dfhc:select templateId="h_ui_select" size="1" name="default_access" id="default_access" pleaseSelect="1" defaultValue="${bean.default_access}" sqlOption="code" columnId="id" columnName="NAME"  code="RM_YES_NOT" />				
				</dfhc:div>
		</dfhc:div>
		<dfhc:div templateId="h_ui_div_row_cl">					
		    <dfhc:title templateId="h_ui_label_title">默认有附加数据：</dfhc:title>	    
				<dfhc:div templateId="h_ui_div_label_div">
					<dfhc:select templateId="h_ui_select" size="1" name="default_is_affix_data" id="default_is_affix_data" pleaseSelect="1" defaultValue="${bean.default_is_affix_data}"  sqlOption="code" columnId="id" columnName="NAME"  code="RM_YES_NOT" />				
				</dfhc:div>
	  </dfhc:div>
	  
	    <dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title">默认递归传播权限：</dfhc:title>	    
				<dfhc:div templateId="h_ui_div_label_div">
					<dfhc:select templateId="h_ui_select" size="1" name="default_is_recursive" id="default_is_recursive" pleaseSelect="1" columnId="id" columnName="NAME" sqlOption="code" defaultValue="${bean.default_is_recursive}"  code="RM_YES_NOT" />				
				</dfhc:div>
			</dfhc:div>
		 <dfhc:div templateId="h_ui_div_row_cl">					
	    <dfhc:title templateId="h_ui_label_title">默认访问方式代码：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.default_access_type}" placeholder="" id="default_access_type" name="default_access_type" />			
	    </dfhc:div>	    		 
		 </dfhc:div>
			
			<dfhc:div templateId="h_ui_div_row_cl">
			    <dfhc:title templateId="h_ui_label_title">树形编码：</dfhc:title>	    
			    <dfhc:div templateId="h_ui_div_label_div">	        
					<dfhc:input templateId="h_ui_input" value="${bean.total_code}" placeholder="" id="total_code" name="total_code"/>			
			    </dfhc:div>	 	    		 
			</dfhc:div>				
	    <dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title">名称：</dfhc:title>	    
		    <dfhc:div templateId="h_ui_div_label_div">	        
				<dfhc:input templateId="h_ui_input" value="${bean.name}" placeholder="" id="name" name="name"/>			
		    </dfhc:div>	 	    		 
		</dfhc:div>	 		 
		

		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:div templateId="h_ui_div_pop_up_button">
				<dfhc:button templateId="h_ui_submit_button" />
			</dfhc:div>
		</dfhc:div>
	</form>
</article>



<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('rm_authorize_resource'));
	</c:if>


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-rmauthorizeresource-add").validate({
		rules:{
			defaultAccess:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			defaultIsAffixData:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			defaultIsRecursive:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			defaultAccessType:{			
				required:true,
				minlength:1,
				maxlength:1000
			},
			totalCode:{			
				maxlength:200
			},
			name:{			
				maxlength:200
			},
			usableStatus:{			
				maxlength:1
			},
			modifyDate:{			
			},
			modifyIp:{			
				maxlength:45
			},
			constraint:{			
			}
		},
 		messages: {
			defaultAccess:{
		        required: "请输入DEFAULT_ACCESS",
		        minlength: "DEFAULT_ACCESS至少由1个字母组成",
		        maxlength: "DEFAULT_ACCESS最大长度为1个字母"
	           },
			defaultIsAffixData:{
		        required: "请输入DEFAULT_IS_AFFIX_DATA",
		        minlength: "DEFAULT_IS_AFFIX_DATA至少由1个字母组成",
		        maxlength: "DEFAULT_IS_AFFIX_DATA最大长度为1个字母"
	           },
			defaultIsRecursive:{
		        required: "请输入DEFAULT_IS_RECURSIVE",
		        minlength: "DEFAULT_IS_RECURSIVE至少由1个字母组成",
		        maxlength: "DEFAULT_IS_RECURSIVE最大长度为1个字母"
	           },
			defaultAccessType:{
		        required: "请输入DEFAULT_ACCESS_TYPE",
		        minlength: "DEFAULT_ACCESS_TYPE至少由1个字母组成",
		        maxlength: "DEFAULT_ACCESS_TYPE最大长度为1000个字母"
	           },
			totalCode:{
		        maxlength: "TOTAL_CODE最大长度为200个字母"
	           },
			name:{
		        maxlength: "NAME最大长度为200个字母"
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmauthorizeresource/insert")%>';
			</c:if>
			<c:if test="${not empty bean}"> 
			
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmauthorizeresource/update")%>';
			</c:if>
			//提交成功关闭
			submitAjax(url,$("#form-rmauthorizeresource-add").serialize(),getRootPath()+"rmauthorizeresource"); 		    		    		
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
